<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\DbConnection\Model\Model;
/**
 * @property int $user_id 
 * @property string $user_name 
 * @property string $email 
 * @property string $password 
 * @property string $ec_salt 
 * @property int $add_time 
 * @property int $last_login 
 * @property string $last_ip 
 * @property string $lang_type 
 * @property string $todolist 
 * @property int $role_id 
 */
class JwAdminUser extends Model
{
    public $timestamps = false;
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'jw_admin_user';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['user_id' => 'integer', 'add_time' => 'integer', 'last_login' => 'integer', 'role_id' => 'integer'];

    public function role()
    {
        return $this->hasOne(JwAdminRole::class, 'role_id', 'role_id');
    }

    public function detail()
    {
        return $this->hasOne(JwAdminUserDetail::class, 'user_id', 'user_id');
    }
}